home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / kingobox.c < prev    next >
C/C++ Source or Header  |  2000-05-04  |  32KB  |  893 lines

  1. /***************************************************************************
  2.  
  3. King of Boxer - (c) 1985 Woodplace Inc.
  4. Ring King - (c) 1985 Data East USA Inc.
  5.  
  6. Preliminary driver by:
  7. Ernesto Corvi
  8. ernesto@imagina.com
  9.  
  10. Notes:
  11. -----
  12. Main CPU:
  13. - Theres a memory area from 0xf000 to 0xf7ff, which is clearly
  14.   initialized at startup and never used anymore.
  15.  
  16. ***************************************************************************/
  17.  
  18. #include "driver.h"
  19. #include "vidhrdw/generic.h"
  20.  
  21. /* from vidhrdw */
  22. extern unsigned char *kingobox_videoram1;
  23. extern unsigned char *kingobox_colorram1;
  24. extern size_t kingobox_videoram1_size;
  25. extern unsigned char *kingobox_scroll_y;
  26. WRITE_HANDLER( kingofb_f800_w );
  27. void kingobox_vh_convert_color_prom(unsigned char *palette,unsigned short *colortable,const unsigned char *color_prom);
  28. void ringking_vh_convert_color_prom(unsigned char *palette,unsigned short *colortable,const unsigned char *color_prom);
  29. void kingobox_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
  30. void ringking_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
  31.  
  32. static unsigned char *video_shared;
  33. static unsigned char *sprite_shared;
  34. int kingofb_nmi_enable = 0;
  35.  
  36. static READ_HANDLER( video_shared_r ) {
  37.     return video_shared[offset];
  38. }
  39.  
  40. static WRITE_HANDLER( video_shared_w ) {
  41.     video_shared[offset] = data;
  42. }
  43.  
  44. static READ_HANDLER( sprite_shared_r ) {
  45.     return sprite_shared[offset];
  46. }
  47.  
  48. static WRITE_HANDLER( sprite_shared_w ) {
  49.     sprite_shared[offset] = data;
  50. }
  51.  
  52. static WRITE_HANDLER( video_interrupt_w ) {
  53.     cpu_cause_interrupt( 1, 0xff );
  54. }
  55.  
  56. static WRITE_HANDLER( sprite_interrupt_w ) {
  57.     cpu_cause_interrupt( 2, 0xff );
  58. }
  59.  
  60. static WRITE_HANDLER( scroll_interrupt_w ) {
  61.     sprite_interrupt_w( offset, data );
  62.     *kingobox_scroll_y = data;
  63. }
  64.  
  65. static WRITE_HANDLER( sound_command_w ) {
  66.     soundlatch_w( 0, data );
  67.     cpu_cause_interrupt( 3, 0xff );
  68. }
  69.  
  70. static struct MemoryReadAddress main_readmem[] =
  71. {
  72.     { 0x0000, 0x7fff, MRA_ROM },
  73.     { 0xc000, 0xc3ff, MRA_RAM }, /* work ram */
  74.     { 0xe000, 0xe7ff, sprite_shared_r },
  75.     { 0xe800, 0xefff, video_shared_r },
  76.     { 0xf000, 0xf7ff, MRA_RAM }, /* ???? */
  77.     { 0xfc00, 0xfc00, input_port_0_r }, /* DSW 0 */
  78.     { 0xfc01, 0xfc01, input_port_1_r }, /* DSW 1 */
  79.     { 0xfc02, 0xfc02, input_port_2_r }, /* Player 1 controls */
  80.     { 0xfc03, 0xfc03, input_port_3_r }, /* Player 2 controls */
  81.     { 0xfc04, 0xfc04, input_port_4_r }, /* Coin & Start */
  82.     { 0xfc05, 0xfc05, input_port_5_r }, /* Player 1 & 2 button 3 */
  83.     { -1 }  /* end of table */
  84. };
  85.  
  86. static struct MemoryWriteAddress main_writemem[] =
  87. {
  88.     { 0x0000, 0x7fff, MWA_ROM },
  89.     { 0xc000, 0xc3ff, MWA_RAM }, /* work ram */
  90.     { 0xe000, 0xe7ff, sprite_shared_w }, /* shared with sprite cpu */
  91.     { 0xe800, 0xefff, video_shared_w }, /* shared with video cpu */
  92.     { 0xf000, 0xf7ff, MWA_RAM }, /* ???? */
  93.     { 0xf800, 0xf800, kingofb_f800_w },    /* NMI enable, palette bank */
  94.     { 0xf801, 0xf801, MWA_NOP }, /* ???? */
  95.     { 0xf802, 0xf802, MWA_RAM, &kingobox_scroll_y },
  96.     { 0xf803, 0xf803, scroll_interrupt_w  },
  97.     { 0xf804, 0xf804, video_interrupt_w },
  98.     { 0xf807, 0xf807, sound_command_w }, /* sound latch */
  99.     { -1 }  /* end of table */
  100. };
  101.  
  102. static struct MemoryReadAddress video_readmem[] =
  103. {
  104.     { 0x0000, 0x3fff, MRA_ROM },
  105.     { 0x8000, 0x87ff, MRA_RAM }, /* work ram */
  106.     { 0xa000, 0xa7ff, video_shared_r }, /* shared with main */
  107.     { 0xc000, 0xc0ff, videoram_r }, /* background vram */
  108.     { 0xc400, 0xc4ff, colorram_r }, /* background colorram */
  109.     { 0xc800, 0xcbff, MRA_RAM }, /* foreground vram */
  110.     { 0xcc00, 0xcfff, MRA_RAM }, /* foreground colorram */
  111.     { -1 }  /* end of table */
  112. };
  113.  
  114. static struct MemoryWriteAddress video_writemem[] =
  115. {
  116.     { 0x0000, 0x3fff, MWA_ROM },
  117.     { 0x8000, 0x87ff, MWA_RAM }, /* work ram */
  118.     { 0xa000, 0xa7ff, video_shared_w, &video_shared }, /* shared with main */
  119.     { 0xc000, 0xc0ff, videoram_w, &videoram, &videoram_size }, /* background vram */
  120.     { 0xc400, 0xc4ff, colorram_w, &colorram }, /* background colorram */
  121.     { 0xc800, 0xcbff, MWA_RAM, &kingobox_videoram1, &kingobox_videoram1_size }, /* foreground vram */
  122.     { 0xcc00, 0xcfff, MWA_RAM, &kingobox_colorram1 }, /* foreground colorram */
  123.     { -1 }  /* end of table */
  124. };
  125.  
  126. static struct MemoryReadAddress sprite_readmem[] =
  127. {
  128.     { 0x0000, 0x1fff, MRA_ROM },
  129.     { 0x8000, 0x87ff, MRA_RAM }, /* work ram */
  130.     { 0xa000, 0xa7ff, sprite_shared_r }, /* shared with main */
  131.     { 0xc000, 0xc3ff, spriteram_r }, /* sprite ram */
  132.     { 0xc400, 0xc43f, MRA_RAM }, /* something related to scroll? */
  133.     { -1 }  /* end of table */
  134. };
  135.  
  136. static struct MemoryWriteAddress sprite_writemem[] =
  137. {
  138.     { 0x0000, 0x1fff, MWA_ROM },
  139.     { 0x8000, 0x87ff, MWA_RAM }, /* work ram */
  140.     { 0xa000, 0xa7ff, sprite_shared_w, &sprite_shared }, /* shared with main */
  141.     { 0xc000, 0xc3ff, spriteram_w, &spriteram, &spriteram_size }, /* sprite ram */
  142.     { 0xc400, 0xc43f, MWA_RAM },  /* something related to scroll? */
  143.     { -1 }  /* end of table */
  144. };
  145.  
  146. static struct MemoryReadAddress sound_readmem[] =
  147. {
  148.     { 0x0000, 0xbfff, MRA_ROM },
  149.     { 0xc000, 0xc3ff, MRA_RAM }, /* work ram */
  150.     { -1 }  /* end of table */
  151. };
  152.  
  153. static struct MemoryWriteAddress sound_writemem[] =
  154. {
  155.     { 0x8000, 0x8000, MWA_NOP }, /* ??? */
  156.     { 0x0000, 0xbfff, MWA_ROM },
  157.     { 0xc000, 0xc3ff, MWA_RAM }, /* work ram */
  158.     { -1 }  /* end of table */
  159. };
  160.  
  161. static struct IOReadPort sound_readport[] =
  162. {
  163.     { 0x08, 0x08, AY8910_read_port_0_r },
  164.     { -1 }  /* end of table */
  165. };
  166.  
  167. static struct IOWritePort sound_writeport[] =
  168. {
  169.     { 0x00, 0x00, DAC_0_data_w },
  170.     { 0x08, 0x08, AY8910_write_port_0_w },
  171.     { 0x0c, 0x0c, AY8910_control_port_0_w },
  172.     { -1 }  /* end of table */
  173. };
  174.  
  175. /* Ring King */
  176. static struct MemoryReadAddress rk_main_readmem[] =
  177. {
  178.     { 0x0000, 0xbfff, MRA_ROM },
  179.     { 0xc000, 0xc3ff, MRA_RAM }, /* work ram */
  180.     { 0xc800, 0xcfff, sprite_shared_r },
  181.     { 0xd000, 0xd7ff, video_shared_r },
  182.     { 0xe000, 0xe000, input_port_0_r }, /* DSW 0 */
  183.     { 0xe001, 0xe001, input_port_1_r }, /* DSW 1 */
  184.     { 0xe002, 0xe002, input_port_2_r }, /* Player 1 controls */
  185.     { 0xe003, 0xe003, input_port_3_r }, /* Player 2 controls */
  186.     { 0xe004, 0xe004, input_port_4_r }, /* Coin & Start */
  187.     { 0xe005, 0xe005, input_port_5_r }, /* Player 1 & 2 button 3 */
  188.     { 0xf000, 0xf7ff, MRA_RAM }, /* ???? */
  189.     { -1 }  /* end of table */
  190. };
  191.  
  192. static struct MemoryWriteAddress rk_main_writemem[] =
  193. {
  194.     { 0x0000, 0xbfff, MWA_ROM },
  195.     { 0xc000, 0xc3ff, MWA_RAM }, /* work ram */
  196.     { 0xc800, 0xcfff, sprite_shared_w },
  197.     { 0xd000, 0xd7ff, video_shared_w },
  198.     { 0xd800, 0xd800, kingofb_f800_w },
  199.     { 0xd801, 0xd801, sprite_interrupt_w },
  200.     { 0xd802, 0xd802, video_interrupt_w },
  201.     { 0xd803, 0xd803, sound_command_w },
  202.     { 0xe800, 0xe800, MWA_RAM, &kingobox_scroll_y },
  203.     { 0xf000, 0xf7ff, MWA_RAM }, /* ???? */
  204.     { -1 }  /* end of table */
  205. };
  206.  
  207. static struct MemoryReadAddress rk_video_readmem[] =
  208. {
  209.     { 0x0000, 0x3fff, MRA_ROM },
  210.     { 0x8000, 0x87ff, MRA_RAM }, /* work ram */
  211.     { 0xc000, 0xc7ff, video_shared_r }, /* shared with main */
  212.     { 0xa800, 0xa8ff, videoram_r }, /* background vram */
  213.     { 0xac00, 0xacff, colorram_r }, /* background colorram */
  214.     { 0xa000, 0xa3ff, MRA_RAM }, /* foreground vram */
  215.     { 0xa400, 0xa7ff, MRA_RAM }, /* foreground colorram */
  216.     { -1 }  /* end of table */
  217. };
  218.  
  219. static struct MemoryWriteAddress rk_video_writemem[] =
  220. {
  221.     { 0x0000, 0x3fff, MWA_ROM },
  222.     { 0x8000, 0x87ff, MWA_RAM }, /* work ram */
  223.     { 0xc000, 0xc7ff, video_shared_w, &video_shared }, /* shared with main */
  224.     { 0xa800, 0xa8ff, videoram_w, &videoram, &videoram_size }, /* background vram */
  225.     { 0xac00, 0xacff, colorram_w, &colorram }, /* background colorram */
  226.     { 0xa000, 0xa3ff, MWA_RAM, &kingobox_videoram1, &kingobox_videoram1_size }, /* foreground vram */
  227.     { 0xa400, 0xa7ff, MWA_RAM, &kingobox_colorram1 }, /* foreground colorram */
  228.     { -1 }  /* end of table */
  229. };
  230.  
  231. static struct MemoryReadAddress rk_sprite_readmem[] =
  232. {
  233.     { 0x0000, 0x1fff, MRA_ROM },
  234.     { 0x8000, 0x87ff, MRA_RAM }, /* work ram */
  235.     { 0xc800, 0xcfff, sprite_shared_r }, /* shared with main */
  236.     { 0xa000, 0xa3ff, spriteram_r }, /* sprite ram */
  237.     { 0xa400, 0xa43f, MRA_RAM }, /* something related to scroll? */
  238.     { -1 }  /* end of table */
  239. };
  240.  
  241. static struct MemoryWriteAddress rk_sprite_writemem[] =
  242. {
  243.     { 0x0000, 0x1fff, MWA_ROM },
  244.     { 0x8000, 0x87ff, MWA_RAM }, /* work ram */
  245.     { 0xc800, 0xcfff, sprite_shared_w, &sprite_shared }, /* shared with main */
  246.     { 0xa000, 0xa3ff, spriteram_w, &spriteram, &spriteram_size }, /* sprite ram */
  247.     { 0xa400, 0xa43f, MWA_RAM },  /* something related to scroll? */
  248.     { -1 }  /* end of table */
  249. };
  250.  
  251. static struct IOReadPort rk_sound_readport[] =
  252. {
  253.     { 0x02, 0x02, AY8910_read_port_0_r },
  254.     { -1 }  /* end of table */
  255. };
  256.  
  257. static struct IOWritePort rk_sound_writeport[] =
  258. {
  259.     { 0x00, 0x00, DAC_0_data_w },
  260.     { 0x02, 0x02, AY8910_write_port_0_w },
  261.     { 0x03, 0x03, AY8910_control_port_0_w },
  262.     { -1 }  /* end of table */
  263. };
  264.  
  265. INPUT_PORTS_START( kingofb )
  266.     PORT_START /* DSW0 - 0xfc01 */
  267.     PORT_DIPNAME( 0x03, 0x01, "Rest Up Points" )
  268.     PORT_DIPSETTING(    0x02, "70000" )
  269.     PORT_DIPSETTING(    0x01, "100000" )
  270.     PORT_DIPSETTING(    0x03, "150000" )
  271.     PORT_DIPSETTING(    0x00, DEF_STR( No ) )
  272.     PORT_DIPNAME( 0x04, 0x00, DEF_STR( Demo_Sounds ) )
  273.     PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
  274.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  275.     PORT_DIPNAME( 0x18, 0x00, DEF_STR( Difficulty ) )
  276.     PORT_DIPSETTING(    0x00, "Easy" )
  277.     PORT_DIPSETTING(    0x08, "Medium" )
  278.     PORT_DIPSETTING(    0x10, "Hard" )
  279.     PORT_DIPSETTING(    0x18, "Hardest" )
  280.     PORT_DIPNAME( 0x20, 0x20, DEF_STR( Cabinet ) )
  281.     PORT_DIPSETTING(    0x20, DEF_STR( Upright ) )
  282.     PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
  283.     PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
  284.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  285.     PORT_DIPSETTING(    0x40, DEF_STR( On ) )
  286.     PORT_SERVICE( 0x80, IP_ACTIVE_HIGH )
  287.  
  288.     PORT_START /* DSW1 - 0xfc01 */
  289.     PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) )
  290.     PORT_DIPSETTING(    0x07, DEF_STR( 4C_1C ) )
  291.     PORT_DIPSETTING(    0x06, DEF_STR( 3C_1C ) )
  292.     PORT_DIPSETTING(    0x05, DEF_STR( 2C_1C ) )
  293.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  294.     PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
  295.     PORT_DIPSETTING(    0x02, DEF_STR( 1C_3C ) )
  296.     PORT_DIPSETTING(    0x03, DEF_STR( 1C_4C ) )
  297.     PORT_DIPSETTING(    0x04, DEF_STR( 1C_5C ) )
  298.     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
  299.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  300.     PORT_DIPSETTING(    0x08, DEF_STR( On ) )
  301.     PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
  302.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  303.     PORT_DIPSETTING(    0x10, DEF_STR( On ) )
  304.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
  305.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  306.     PORT_DIPSETTING(    0x20, DEF_STR( On ) )
  307.     PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
  308.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  309.     PORT_DIPSETTING(    0x40, DEF_STR( On ) )
  310.     PORT_DIPNAME( 0x80, 0x00, "Freeze" )
  311.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  312.     PORT_DIPSETTING(    0x80, DEF_STR( On ) )
  313.  
  314.     PORT_START /* IN 0 - 0xfc02 */
  315.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )
  316.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )
  317.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )
  318.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )
  319.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
  320.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 )
  321.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  322.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  323.  
  324.     PORT_START /* IN 1 - 0xfc03 */
  325.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP | IPF_COCKTAIL )
  326.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN | IPF_COCKTAIL )
  327.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_COCKTAIL )
  328.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT | IPF_COCKTAIL )
  329.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_COCKTAIL )
  330.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 | IPF_COCKTAIL )
  331.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  332.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  333.  
  334.     PORT_START /* IN 2 - 0xfc04 */
  335.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
  336.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  337.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
  338.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START2 )
  339.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  340.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  341.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  342.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  343.  
  344.     PORT_START /* IN 3 - 0xfc05 */
  345.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON3 )
  346.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON3 | IPF_COCKTAIL )
  347.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  348.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  349.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  350.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  351.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  352.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  353. INPUT_PORTS_END
  354.  
  355. /* Ring King */
  356. INPUT_PORTS_START( ringking )
  357.     PORT_START /* DSW0 - 0xe000 */
  358.     PORT_DIPNAME( 0x03, 0x03, "Replay" )
  359.     PORT_DIPSETTING(    0x01, "70000" )
  360.     PORT_DIPSETTING(    0x02, "100000" )
  361.     PORT_DIPSETTING(    0x00, "150000" )
  362.     PORT_DIPSETTING(    0x03, DEF_STR( No ) )
  363.     PORT_DIPNAME( 0x04, 0x04, DEF_STR( Demo_Sounds ) )
  364.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  365.     PORT_DIPSETTING(    0x04, DEF_STR( On ) )
  366.     PORT_DIPNAME( 0x18, 0x10, "Difficulty(2P)" )
  367.     PORT_DIPSETTING(    0x18, "Easy" )
  368.     PORT_DIPSETTING(    0x10, "Medium" )
  369.     PORT_DIPSETTING(    0x08, "Hard" )
  370.     PORT_DIPSETTING(    0x00, "Hardest" )
  371.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) )
  372.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  373.     PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )
  374.     PORT_BIT(            0x40, IP_ACTIVE_LOW, IPT_UNUSED )
  375.     PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
  376.  
  377.     PORT_START /* DSW1 - 0xe001 */
  378.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) )
  379.     PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
  380.     PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
  381.     PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )
  382.     PORT_DIPSETTING(    0x01, DEF_STR( 1C_3C ) )
  383.     PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_B ) )
  384.     PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
  385.     PORT_DIPSETTING(    0x0c, DEF_STR( 1C_1C ) )
  386.     PORT_DIPSETTING(    0x08, DEF_STR( 1C_2C ) )
  387.     PORT_DIPSETTING(    0x04, DEF_STR( 1C_3C ) )
  388.     PORT_DIPNAME( 0x30, 0x10, "Difficulty(1P)" )
  389.     PORT_DIPSETTING(    0x30, "Easy" )
  390.     PORT_DIPSETTING(    0x10, "Medium" )
  391.     PORT_DIPSETTING(    0x20, "Hard" )
  392.     PORT_DIPSETTING(    0x00, "Hardest" )
  393.     PORT_DIPNAME( 0x40, 0x40, "Boxing Match" )
  394.     PORT_DIPSETTING(    0x40, "2 Win,End" )
  395.     PORT_DIPSETTING(    0x00, "1 Win,End" )
  396.     PORT_DIPNAME( 0x80, 0x80, "Freeze" )
  397.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  398.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  399.  
  400.     PORT_START /* IN 0 - 0xe002 */
  401.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )
  402.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
  403.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
  404.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
  405.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
  406.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
  407.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
  408.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
  409.  
  410.     PORT_START /* IN 1 - 0xe003 */
  411.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_COCKTAIL )
  412.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_COCKTAIL )
  413.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_COCKTAIL )
  414.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_COCKTAIL )
  415.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
  416.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_COCKTAIL )
  417.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
  418.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
  419.  
  420.     PORT_START /* IN 2 - 0xe004 */
  421.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
  422.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_TILT ) /* Service Switch */
  423.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 )
  424.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 )
  425.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* Sound busy??? */
  426.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_VBLANK )
  427.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
  428.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
  429.  
  430.     PORT_START /* IN 3 - 0xfc05 */
  431.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 )
  432.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 | IPF_COCKTAIL )
  433.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
  434.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 )
  435.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
  436.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
  437.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
  438.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
  439. INPUT_PORTS_END
  440.  
  441.  
  442.  
  443. static struct GfxLayout charlayout =
  444. {
  445.     8,8,    /* 8*8 characters */
  446.     512,   /* 1024 characters */
  447.     1,      /* 1 bits per pixel */
  448.     { 0 },     /* only 1 plane */
  449.     { 0, 1, 2, 3, 4, 5, 6, 7 },
  450.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
  451.     8*8     /* every char takes 8 consecutive bytes */
  452. };
  453.  
  454. static struct GfxLayout spritelayout =
  455. {
  456.     16,16,    /* 16*16 chars */
  457.     1024,     /* 1024 characters */
  458.     3,        /* bits per pixel */
  459.     { 2*0x4000*8, 1*0x4000*8, 0*0x4000*8 },
  460.     { 3*0x4000*8+0,3*0x4000*8+1,3*0x4000*8+2,3*0x4000*8+3,
  461.             3*0x4000*8+4,3*0x4000*8+5,3*0x4000*8+6,3*0x4000*8+7,
  462.             0, 1, 2, 3, 4, 5, 6, 7 },
  463.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
  464.             8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 },
  465.     16*8
  466. };
  467.  
  468. static struct GfxLayout tilelayout =
  469. {
  470.     16,16,    /* 16*16 chars */
  471.     512,    /* 512 characters */
  472.     3,        /* bits per pixel */
  473.     { 2*0x2000*8, 1*0x2000*8, 0*0x2000*8 },
  474.     { 3*0x2000*8+0,3*0x2000*8+1,3*0x2000*8+2,3*0x2000*8+3,
  475.             3*0x2000*8+4,3*0x2000*8+5,3*0x2000*8+6,3*0x2000*8+7,
  476.             0, 1, 2, 3, 4, 5, 6, 7 },
  477.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
  478.             8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 },
  479.     16*8
  480. };
  481.  
  482. static struct GfxDecodeInfo gfxdecodeinfo[] =
  483. {
  484.     { REGION_GFX1, 0x00000, &charlayout,   256,  8 },    /* characters */
  485.     { REGION_GFX1, 0x01000, &charlayout,   256,  8 },    /* characters */
  486.     { REGION_GFX2, 0x00000, &spritelayout,   0, 32 },    /* sprites */
  487.     { REGION_GFX3, 0x00000, &tilelayout,     0, 32 },    /* bg tiles */
  488.     { -1 } /* end of array */
  489. };
  490.  
  491. /* Ring King */
  492. static struct GfxLayout rk_charlayout1 =
  493. {
  494.     8,8,    /* 8*8 characters */
  495.     512,   /* 1024 characters */
  496.     1,      /* 1 bits per pixel */
  497.     { 0 },     /* only 1 plane */
  498.     { 7, 6, 5, 4, (0x1000*8)+7, (0x1000*8)+6, (0x1000*8)+5, (0x1000*8)+4 },
  499.     { 7*8, 6*8, 5*8, 4*8, 3*8, 2*8, 1*8, 0*8 },
  500.     8*8     /* every char takes 8 consecutive bytes */
  501. };
  502.  
  503. static struct GfxLayout rk_charlayout2 =
  504. {
  505.     8,8,    /* 8*8 characters */
  506.     512,   /* 1024 characters */
  507.     1,      /* 1 bits per pixel */
  508.     { 0 },     /* only 1 plane */
  509.     { 3, 2, 1, 0, (0x1000*8)+3, (0x1000*8)+2, (0x1000*8)+1, (0x1000*8)+0 },
  510.     { 7*8, 6*8, 5*8, 4*8, 3*8, 2*8, 1*8, 0*8 },
  511.     8*8     /* every char takes 8 consecutive bytes */
  512. };
  513.  
  514. static struct GfxLayout rk_spritelayout =
  515. {
  516.     16,16,    /* 16*16 chars */
  517.     1024,     /* 1024 characters */
  518.     3,        /* bits per pixel */
  519.     { 0*0x8000*8, 1*0x8000*8, 2*0x8000*8 },
  520.     { 7, 6, 5, 4, 3, 2, 1, 0,
  521.         16*8+7, 16*8+6, 16*8+5, 16*8+4, 16*8+3, 16*8+2, 16*8+1, 16*8+0 },
  522.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
  523.             8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 },
  524.     32*8
  525. };
  526.  
  527. static struct GfxLayout rk_tilelayout =
  528. {
  529.     16,16,    /* 16*16 chars */
  530.     512,     /* 1024 characters */
  531.     3,        /* bits per pixel */
  532.     { 0*0x4000*8, 1*0x4000*8, 2*0x4000*8 },
  533.     { 7, 6, 5, 4, 3, 2, 1, 0,
  534.         16*8+7, 16*8+6, 16*8+5, 16*8+4, 16*8+3, 16*8+2, 16*8+1, 16*8+0 },
  535.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
  536.             8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 },
  537.     32*8
  538. };
  539.  
  540. static struct GfxLayout rk_bglayout =
  541. {
  542.     16,16,    /* 16*16 chars */
  543.     256,     /* 1024 characters */
  544.     3,        /* bits per pixel */
  545.     { 0x4000*8+4, 0, 4 },
  546.     { 16*8+3, 16*8+2, 16*8+1, 16*8+0, 0x2000*8+3, 0x2000*8+2, 0x2000*8+1, 0x2000*8+0,
  547.         3, 2, 1, 0, 0x2010*8+3, 0x2010*8+2, 0x2010*8+1, 0x2010*8+0 },
  548.     { 15*8, 14*8, 13*8, 12*8, 11*8, 10*8, 9*8, 8*8,
  549.             7*8, 6*8, 5*8, 4*8, 3*8, 2*8, 1*8, 0*8 },
  550.     32*8
  551. };
  552.  
  553.  
  554. static struct GfxDecodeInfo rk_gfxdecodeinfo[] =
  555. {
  556.     { REGION_GFX1, 0x00000, &rk_charlayout1,  256,  8 },    /* characters */
  557.     { REGION_GFX1, 0x00000, &rk_charlayout2,  256,  8 },    /* characters */
  558.     { REGION_GFX2, 0x00000, &rk_spritelayout,   0, 32 },    /* sprites */
  559.     { REGION_GFX3, 0x00000, &rk_tilelayout,     0, 32 },    /* sprites/bg tiles */
  560.     { REGION_GFX4, 0x00000, &rk_bglayout,       0, 32 },    /* bg tiles */
  561.     { -1 } /* end of array */
  562. };
  563.  
  564. static struct AY8910interface ay8910_interface =
  565. {
  566.     1,    /* 1 chip */
  567.     1500000,    /* 1.5 MHz ? */
  568.     { 25 },
  569.     { soundlatch_r },
  570.     { 0 },
  571.     { 0 },
  572.     { 0 }
  573. };
  574.  
  575. static struct DACinterface dac_interface =
  576. {
  577.     1,
  578.     { 25 }
  579. };
  580.  
  581. static int kingobox_interrupt( void ) {
  582.  
  583.     if ( kingofb_nmi_enable )
  584.         return nmi_interrupt();
  585.  
  586.     return ignore_interrupt();
  587. }
  588.  
  589. static struct MachineDriver machine_driver_kingofb =
  590. {
  591.     /* basic machine hardware */
  592.     {
  593.         {
  594.             CPU_Z80,
  595.             4000000,        /* 4.0 Mhz */
  596.             main_readmem, main_writemem,0,0,
  597.             kingobox_interrupt,1
  598.         },
  599.         {
  600.             CPU_Z80,
  601.             4000000,        /* 4.0 Mhz */
  602.             video_readmem, video_writemem,0,0,
  603.             kingobox_interrupt,1
  604.         },
  605.         {
  606.             CPU_Z80,
  607.             4000000,        /* 4.0 Mhz */
  608.             sprite_readmem, sprite_writemem,0,0,
  609.             kingobox_interrupt,1
  610.         },
  611.         {
  612.             CPU_Z80 | CPU_AUDIO_CPU,
  613.             4000000,        /* 4.0 Mhz */
  614.             sound_readmem, sound_writemem,sound_readport,sound_writeport,
  615.             ignore_interrupt, 0,
  616.             nmi_interrupt, 6000    /* Hz */
  617.         }
  618.     },
  619.     60, DEFAULT_REAL_60HZ_VBLANK_DURATION,  /* frames per second, vblank duration */
  620.     100, /* We really need heavy synching among the processors */
  621.     0,
  622.  
  623.     /* video hardware */
  624.     32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },
  625.     gfxdecodeinfo,
  626.     256+8, 256+8*2,
  627.     kingobox_vh_convert_color_prom,
  628.  
  629.     VIDEO_TYPE_RASTER,
  630.     0,
  631.     generic_vh_start,
  632.     generic_vh_stop,
  633.     kingobox_vh_screenrefresh,
  634.  
  635.     /* sound hardware */
  636.     0,0,0,0,
  637.     {
  638.         {
  639.             SOUND_AY8910,
  640.             &ay8910_interface
  641.         },
  642.         {
  643.             SOUND_DAC,
  644.             &dac_interface
  645.         }
  646.     }
  647. };
  648.  
  649.  
  650. /* Ring King */
  651. static struct MachineDriver machine_driver_ringking =
  652. {
  653.     /* basic machine hardware */
  654.     {
  655.         {
  656.             CPU_Z80,
  657.             4000000,        /* 4.0 Mhz */
  658.             rk_main_readmem, rk_main_writemem,0,0,
  659.             kingobox_interrupt,1
  660.         },
  661.         {
  662.             CPU_Z80,
  663.             4000000,        /* 4.0 Mhz */
  664.             rk_video_readmem, rk_video_writemem,0,0,
  665.             kingobox_interrupt,1
  666.         },
  667.         {
  668.             CPU_Z80,
  669.             4000000,        /* 4.0 Mhz */
  670.             rk_sprite_readmem, rk_sprite_writemem,0,0,
  671.             kingobox_interrupt,1
  672.         },
  673.         {
  674.             CPU_Z80 | CPU_AUDIO_CPU,
  675.             4000000,        /* 4.0 Mhz */
  676.             sound_readmem, sound_writemem,rk_sound_readport,rk_sound_writeport,
  677.             ignore_interrupt, 0,
  678.             nmi_interrupt, 6000    /* Hz */
  679.         }
  680.     },
  681.     60, DEFAULT_REAL_60HZ_VBLANK_DURATION,  /* frames per second, vblank duration */
  682.     100, /* We really need heavy synching among the processors */
  683.     0,
  684.  
  685.     /* video hardware */
  686.     32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },
  687.     rk_gfxdecodeinfo,
  688.     256+8, 256+8*2,
  689.     ringking_vh_convert_color_prom,
  690.  
  691.     VIDEO_TYPE_RASTER,
  692.     0,
  693.     generic_vh_start,
  694.     generic_vh_stop,
  695.     ringking_vh_screenrefresh,
  696.  
  697.     /* sound hardware */
  698.     0,0,0,0,
  699.     {
  700.         {
  701.             SOUND_AY8910,
  702.             &ay8910_interface
  703.         },
  704.         {
  705.             SOUND_DAC,
  706.             &dac_interface
  707.         }
  708.     }
  709. };
  710.  
  711.  
  712. /***************************************************************************
  713.  
  714.   Game driver(s)
  715.  
  716. ***************************************************************************/
  717.  
  718. ROM_START( kingofb )
  719.     ROM_REGION( 0x10000, REGION_CPU1 )     /* 64k for code */
  720.     ROM_LOAD( "d09_22.bin",   0x00000, 0x4000, 0x6220bfa2 )
  721.     ROM_LOAD( "e09_23.bin",   0x04000, 0x4000, 0x5782fdd8 )
  722.  
  723.     ROM_REGION( 0x10000, REGION_CPU2 )     /* 64k for the video cpu */
  724.     ROM_LOAD( "b09_21.bin",   0x00000, 0x4000, 0x3fb39489 )
  725.  
  726.     ROM_REGION( 0x10000, REGION_CPU3 )     /* 64k for the sprite cpu */
  727.     ROM_LOAD( "j09_dcr.bin",  0x00000, 0x2000, 0x379f4f84 )
  728.  
  729.     ROM_REGION( 0x10000, REGION_CPU4 )     /* 64k for the audio cpu */
  730.     ROM_LOAD( "f05_18.bin",   0x00000, 0x4000, 0xc057e28e )
  731.     ROM_LOAD( "h05_19.bin",   0x04000, 0x4000, 0x060253dd )
  732.     ROM_LOAD( "j05_20.bin",   0x08000, 0x4000, 0x64c137a4 )
  733.  
  734.     ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  735.     ROM_LOAD( "vd15_13.bin",  0x00000, 0x2000, 0xe36d4f4f ) /* characters */
  736.  
  737.     ROM_REGION( 0x18000, REGION_GFX2 | REGIONFLAG_DISPOSE )    /* sprites */
  738.     ROM_LOAD( "vb01_01.bin",  0x00000, 0x4000, 0xce6580af )
  739.     ROM_LOAD( "vb04_03.bin",  0x04000, 0x4000, 0xcf74ea50 )
  740.     ROM_LOAD( "vb07_05.bin",  0x08000, 0x4000, 0xd8b53975 )
  741.     ROM_LOAD( "vb03_02.bin",  0x0c000, 0x4000, 0x4ab506d2 )
  742.     ROM_LOAD( "vb05_04.bin",  0x10000, 0x4000, 0xecf95a2c )
  743.     ROM_LOAD( "vb08_06.bin",  0x14000, 0x4000, 0x8200cb2b )
  744.  
  745.     ROM_REGION( 0xc000, REGION_GFX3 | REGIONFLAG_DISPOSE )    /* tiles */
  746.     ROM_LOAD( "vd01_07.bin",  0x00000, 0x2000, 0x3d472a22 )
  747.     ROM_LOAD( "vd04_09.bin",  0x02000, 0x2000, 0xcc002ea9 )
  748.     ROM_LOAD( "vd07_11.bin",  0x04000, 0x2000, 0x23c1b3ee )
  749.     ROM_LOAD( "vd03_08.bin",  0x06000, 0x2000, 0xd6b1b8fe )
  750.     ROM_LOAD( "vd05_10.bin",  0x08000, 0x2000, 0xfce71e5a )
  751.     ROM_LOAD( "vd08_12.bin",  0x0a000, 0x2000, 0x3f68b991 )
  752.  
  753.     ROM_REGION( 0x0300, REGION_PROMS )
  754.     ROM_LOAD( "vb14_col.bin", 0x0000, 0x0100, 0xc58e5121 )    /* red component */
  755.     ROM_LOAD( "vb15_col.bin", 0x0100, 0x0100, 0x5ab06f25 )    /* green component */
  756.     ROM_LOAD( "vb16_col.bin", 0x0200, 0x0100, 0x1171743f )    /* blue component */
  757. ROM_END
  758.  
  759. /* Ring King */
  760. ROM_START( ringking )
  761.     ROM_REGION( 0x10000, REGION_CPU1 )     /* 64k for code */
  762.     ROM_LOAD( "cx13.9f",      0x00000, 0x8000, 0x93e38c02 )
  763.     ROM_LOAD( "cx14.11f",     0x08000, 0x4000, 0xa435acb0 )
  764.  
  765.     ROM_REGION( 0x10000, REGION_CPU2 )     /* 64k for the video cpu */
  766.     ROM_LOAD( "cx07.10c",     0x00000, 0x4000, 0x9f074746 )
  767.  
  768.     ROM_REGION( 0x10000, REGION_CPU3 )     /* 64k for the sprite cpu */
  769.     ROM_LOAD( "cx00.4c",      0x00000, 0x2000, 0x880b8aa7 )
  770.  
  771.     ROM_REGION( 0x10000, REGION_CPU4 )     /* 64k for the audio cpu */
  772.     ROM_LOAD( "cx12.4ef",     0x00000, 0x8000, 0x1d5d6c6b )
  773.     ROM_LOAD( "j05_20.bin",   0x08000, 0x4000, 0x64c137a4 )
  774.  
  775.     ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  776.     ROM_LOAD( "cx08.13b",     0x00000, 0x2000, 0xdbd7c1c2 )    /* characters */
  777.  
  778.     ROM_REGION( 0x18000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  779.     ROM_LOAD( "cx04.11j",     0x00000, 0x8000, 0x506a2ed9 )
  780.     ROM_LOAD( "cx02.8j",      0x08000, 0x8000, 0x009dde6a )
  781.     ROM_LOAD( "cx06.13j",     0x10000, 0x8000, 0xd819a3b2 )
  782.  
  783.     ROM_REGION( 0xc000, REGION_GFX3 | REGIONFLAG_DISPOSE )
  784.     ROM_LOAD( "cx03.9j",      0x00000, 0x4000, 0x682fd1c4 )    /* sprites */
  785.     ROM_LOAD( "cx01.7j",      0x04000, 0x4000, 0x85130b46 )
  786.     ROM_LOAD( "cx05.12j",     0x08000, 0x4000, 0xf7c4f3dc )
  787.  
  788.     ROM_REGION( 0x8000, REGION_GFX4 | REGIONFLAG_DISPOSE )
  789.     ROM_LOAD( "cx09.17d",     0x00000, 0x4000, 0x37a082cf )    /* tiles */
  790.     ROM_LOAD( "cx10.17e",     0x04000, 0x4000, 0xab9446c5 )
  791.  
  792.     ROM_REGION( 0x0200, REGION_PROMS )
  793.     ROM_LOAD( "82s135.2a",    0x0000, 0x0100, 0x0e723a83 )    /* red and green component */
  794.     ROM_LOAD( "82s129.1a",    0x0100, 0x0100, 0xd345cbb3 )    /* blue component */
  795. ROM_END
  796.  
  797. ROM_START( ringkin2 )
  798.     ROM_REGION( 0x10000, REGION_CPU1 )     /* 64k for code */
  799.     ROM_LOAD( "rkngm1.bin",   0x00000, 0x8000, 0x086921ea )
  800.     ROM_LOAD( "rkngm2.bin",   0x08000, 0x4000, 0xc0b636a4 )
  801.  
  802.     ROM_REGION( 0x10000, REGION_CPU2 )     /* 64k for the video cpu */
  803.     ROM_LOAD( "rkngtram.bin", 0x00000, 0x4000, 0xd9dc1a0a )
  804.  
  805.     ROM_REGION( 0x10000, REGION_CPU3 )     /* 64k for the sprite cpu */
  806.     ROM_LOAD( "cx00.4c",      0x00000, 0x2000, 0x880b8aa7 )
  807.  
  808.     ROM_REGION( 0x10000, REGION_CPU4 )     /* 64k for the audio cpu */
  809.     ROM_LOAD( "cx12.4ef",     0x00000, 0x8000, 0x1d5d6c6b )
  810.     ROM_LOAD( "j05_20.bin",   0x08000, 0x4000, 0x64c137a4 )
  811.  
  812.     ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  813.     ROM_LOAD( "cx08.13b",     0x00000, 0x2000, 0xdbd7c1c2 )    /* characters */
  814.  
  815.     ROM_REGION( 0x18000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  816.     ROM_LOAD( "cx04.11j",     0x00000, 0x8000, 0x506a2ed9 )
  817.     ROM_LOAD( "cx02.8j",      0x08000, 0x8000, 0x009dde6a )
  818.     ROM_LOAD( "cx06.13j",     0x10000, 0x8000, 0xd819a3b2 )
  819.  
  820.     ROM_REGION( 0xc000, REGION_GFX3 | REGIONFLAG_DISPOSE )
  821.     ROM_LOAD( "cx03.9j",      0x00000, 0x4000, 0x682fd1c4 )    /* sprites */
  822.     ROM_LOAD( "cx01.7j",      0x04000, 0x4000, 0x85130b46 )
  823.     ROM_LOAD( "cx05.12j",     0x08000, 0x4000, 0xf7c4f3dc )
  824.  
  825.     ROM_REGION( 0x8000, REGION_GFX4 | REGIONFLAG_DISPOSE )
  826.     ROM_LOAD( "cx09.17d",     0x00000, 0x4000, 0x37a082cf )    /* tiles */
  827.     ROM_LOAD( "cx10.17e",     0x04000, 0x4000, 0xab9446c5 )
  828.  
  829.     ROM_REGION( 0x0200, REGION_PROMS )
  830.     ROM_LOAD( "82s135.2a",    0x0000, 0x0100, 0x0e723a83 )    /* red and green component */
  831.     ROM_LOAD( "82s129.1a",    0x0100, 0x0100, 0xd345cbb3 )    /* blue component */
  832. ROM_END
  833.  
  834. ROM_START( ringkin3 )
  835.     ROM_REGION( 0x10000, REGION_CPU1 )     /* 64k for code */
  836.     ROM_LOAD( "14.9d",        0x00000, 0x4000, 0x63627b8b )
  837.     ROM_LOAD( "15.9e",        0x04000, 0x4000, 0xe7557489 )
  838.     ROM_LOAD( "16.9f",        0x08000, 0x4000, 0xa3b3bb16 )
  839.  
  840.     ROM_REGION( 0x10000, REGION_CPU2 )     /* 64k for the video cpu */
  841.     ROM_LOAD( "13.9b",        0x00000, 0x4000, 0xf33f94a2 )
  842.  
  843.     ROM_REGION( 0x10000, REGION_CPU3 )     /* 64k for the sprite cpu */
  844.     ROM_LOAD( "j09_dcr.bin",  0x00000, 0x2000, 0x379f4f84 )
  845.  
  846.     ROM_REGION( 0x10000, REGION_CPU4 )     /* 64k for the audio cpu */
  847.     ROM_LOAD( "f05_18.bin",   0x00000, 0x4000, 0xc057e28e )
  848.     ROM_LOAD( "h05_19.bin",   0x04000, 0x4000, 0x060253dd )
  849.     ROM_LOAD( "j05_20.bin",   0x08000, 0x4000, 0x64c137a4 )
  850.  
  851.     ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  852.     ROM_LOAD( "12.15d",       0x00000, 0x2000, 0x988a77bf ) /* characters (Japanese) */
  853.  
  854.     ROM_REGION( 0x18000, REGION_GFX2 | REGIONFLAG_DISPOSE )    /* sprites */
  855.     ROM_LOAD( "vb01_01.bin",  0x00000, 0x4000, 0xce6580af )
  856.     ROM_LOAD( "vb04_03.bin",  0x04000, 0x4000, 0xcf74ea50 )
  857.     ROM_LOAD( "vb07_05.bin",  0x08000, 0x4000, 0xd8b53975 )
  858.     ROM_LOAD( "vb03_02.bin",  0x0c000, 0x4000, 0x4ab506d2 )
  859.     ROM_LOAD( "vb05_04.bin",  0x10000, 0x4000, 0xecf95a2c )
  860.     ROM_LOAD( "vb08_06.bin",  0x14000, 0x4000, 0x8200cb2b )
  861.  
  862.     ROM_REGION( 0xc000, REGION_GFX3 | REGIONFLAG_DISPOSE )    /* tiles */
  863.     ROM_LOAD( "7.1d",         0x00000, 0x2000, 0x019a88b0 )
  864.     ROM_LOAD( "9.4d",         0x02000, 0x2000, 0xbfdc741a )
  865.     ROM_LOAD( "11.7d",        0x04000, 0x2000, 0x3cc7bdc5 )
  866.     ROM_LOAD( "8.3d",         0x06000, 0x2000, 0x65f1281b )
  867.     ROM_LOAD( "10.5d",        0x08000, 0x2000, 0xaf5013e7 )
  868.     ROM_LOAD( "12.8d",        0x0a000, 0x2000, 0x00000000 )
  869.  
  870.     ROM_REGION( 0x0300, REGION_PROMS )
  871.     /* we load the ringking PROMs and then expand the first to look like the kingobox ones... */
  872.     ROM_LOAD( "82s135.2a",    0x0100, 0x0100, 0x0e723a83 )    /* red and green component */
  873.     ROM_LOAD( "82s129.1a",    0x0200, 0x0100, 0xd345cbb3 )    /* blue component */
  874. ROM_END
  875.  
  876.  
  877. static void init_ringkin3(void)
  878. {
  879.     int i;
  880.     unsigned char *RAM = memory_region(REGION_PROMS);
  881.  
  882.     /* expand the first color PROM to look like the kingobox ones... */
  883.     for (i = 0;i < 0x100;i++)
  884.         RAM[i] = RAM[i + 0x100] >> 4;
  885. }
  886.  
  887.  
  888.  
  889. GAME( 1985, kingofb,  0,       kingofb,  kingofb,  0,        ROT90, "Woodplace Inc.", "King of Boxer (English)" )
  890. GAME( 1985, ringking, kingofb, ringking, ringking, 0,        ROT90, "Data East USA", "Ring King (set 1)" )
  891. GAMEX(1985, ringkin2, kingofb, ringking, kingofb,  0,        ROT90, "<unknown>", "Ring King (set 2)", GAME_NOT_WORKING )
  892. GAME( 1985, ringkin3, kingofb, kingofb,  kingofb,  ringkin3, ROT90, "Data East USA", "Ring King (set 3)" )
  893.